<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            width: auto;
            height: 1500px;
            border: 1px solid blue;
        }
        
        .top {
            height: 60px;
            width: 100%;
            background-color: #333;
            /* 固定定位，相对浏览器窗口 */
            position: fixed;
            top: 0;
            /* z-index 设置堆叠顺序 */
            z-index: 1000;
        }
        
        li {
            display: inline;
        }
        
        .my-relative {
            width: 200px;
            height: 200px;
            background-color: blue;
            margin-top: 60px;
            /* 相对定位，相对正常位置 */
            position: relative;
            top: 100px;
            left: 100px;
        }
        
        .my-absolute {
            width: 200px;
            height: 200px;
            background-color: red;
            /* 绝对定位，相对于static定位以外的第一个父级元素定位 */
            /* 本例子中，my-relative 是第一个父级元素 */
            position: absolute;
            top: 50px;
            left: 50px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="top">
            <nav>
                <ul>
                    <li>
                        <a href="aboutus.html">About Us</a>
                    </li>
                    <li>
                        <a href="rooms.html">Rooms</a>
                    </li>
                    <li>
                        <a href="facilities.hmtl">Facilities</a>
                    </li>
                    <li>
                        <a href="contactus.html">Contact Us</a>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="my-relative">
            <div class="my-absolute"></div>
        </div>
    </div>
</body>

</html>